var Alist = {
    init: function() {
        var photoCss = "background-size: cover;-webkit-background-size: cover;"
        //begin
        $ajax({
            url: "/group/groupList",
            data: {_id:CurrentUser._id},
            success: function(res) {
                var groups = res.result;
                var html='<div class="ub ub-f1 ufp8"></div>';
                var ubbClass = "";
                if(!groups||groups.length==0||groups==undefined){
                     html +='<div class="ub ub-ver ub-f1 tx-c '+ ubbClass +' b_list">'+
                        '<div class="ub ub-ac ub-f1 umt_p50">'+(CurrentUser.category==30?"你可通过返回通讯录点击'+'创建群聊选项，将其保存到这里O(∩_∩)O":"You can save it by returning the address book to '+' creating a group chat option.(∩_∩)")+'</div>'+
                    '</div>'+
                '</div>';
                } else{
                    SetLS("groupchat_list",res.result);
                for (var i=0; i<groups.length; ++i) { 
                        html += '<div id="row_'+i+'" class="ub up_list2 detailEvt" ontouchstart="zy_touch()" onclick="Alist.go2chat('+i+')">'+
                                '    <div class="uw2 uh2 ub_img_cover detailEvt" style="background-image:url(../img/foreign.png)"></div>'+
                                '    <div class="ub-f1 ub ub-ver upl_p5">'+
                                '        <div class="ub-f1 ub">'+
                                '            <div class="ub-f1 ub_left">'+ groups[i].name  +'</div>'+
                                '        </div>'+
                                '    </div>'+
                                '</div>';
                    }
                                
              }//end else
                $("#ctn").html(html);
           }
                
            
        });//end function
    },
       go2chat: function(pos) {
        var groupchatDetail = GetLS("groupchat_list")[pos];
             groupchatDetail.rowindex=pos;
             SetLS("groupchat_detail", groupchatDetail);
             OpenNewWin("groupchat_detail");
     
    },removeRow:function(){
       var  groupchat_detail=GetLS("groupchat_detail");
       $("#row_"+groupchat_detail.rowindex).remove();
    }
}